using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using OneSoft.EntityCore;
using OneSoft.DataAccess;
using BySoft.Server.Common.Entity;
using BySoft.Server.Common.Schema;
using BySoft.Server.DataAccess;

namespace BySoft.Server.Business
{
	/// <summary>
	/// MdProcess
	/// </summary>
    public partial class MdProcess
    {
        public static bool IsProcessExists(string ProcessName, string ProcessID)
        {
            return MdProcessDA.IsProcessExists(ProcessName,ProcessID);
        }

        public static bool Update(MdProcessEntity product)
        {
            bool istag = true;
            using (DataAccessBroker broker = DataAccessFactory.Instance())
            {
                broker.BeginTransaction();
                try
                {
                    DataAccessCommon.UpdateOnly(product, broker);
                    broker.Commit();
                }
                catch
                {
                    istag = false;
                    broker.Rollback();
                    throw;
                }
            }
            return istag;
        }

        public static DataTable SelectList(string ProcessName, int pageIndex, int pageSize, out int m_count)
        {
            return MdProcessDA.SelectList(ProcessName, pageIndex, pageSize, out m_count);
        }

        public static bool Del(string strCode)
        {
            bool istag = true;
            using (DataAccessBroker broker = DataAccessFactory.Instance())
            {
                broker.BeginTransaction();
                try
                {
                    ClsCommDA.Del("MD_Process", "ProcessID", strCode, broker);
                    broker.Commit();
                }
                catch
                {
                    istag = false;
                    broker.Rollback();
                    throw;
                }
            }
            return istag;
        }
    }
}
